package com.test.core;

import java.io.File;
import java.io.IOException;

import org.beetl.core.Configuration;
import org.beetl.core.GroupTemplate;
import org.beetl.core.resource.FileResourceLoader;

/**
 * 本地模块模版引擎初始化
 * @author Administrator
 *
 */
public class LocalCreat implements CreatCore  {

	@Override
	public GroupTemplate getTemplate(String name) throws IOException {
		String root = System.getProperty("user.dir")+File.separator+name;
		FileResourceLoader resourceLoader = new FileResourceLoader(root,"utf-8");
		Configuration cfg;
		cfg = Configuration.defaultConfiguration();
		GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
		return gt;
	}

	public static LocalCreat getLocalCreat(){
		return new LocalCreat();
	}
}
